<h1><b>List Board</b></h1>
<table>
	<tr>
		<th>id</th>
		<th>userId</th>
		<th>name</th>
		<th>description</th>
		<th>creadted</th>
		<th>updated</th>
		<th>action</th>
	</tr>

	<?php $i=0; foreach($boardFolloweds as $boardFollowed): $i++; ?>
	<tr>
		<td><?php echo $boardFollowed['Board']['id'] ?></td>
		<td><?php echo $boardFollowed['Board']['user_id'] ?></td>
		<td><?php echo $boardFollowed['Board']['name'] ?></td>
		<td><?php echo $boardFollowed['Board']['description'] ?></td>
		<td><?php echo $boardFollowed['Board']['created'] ?></td>
		<td><?php echo $boardFollowed['Board']['updated'] ?></td>
		<td><?php 
				echo $this->Html->link('unfollow', array('action'=>'unfollowBoard', $boardFollowed['Board']['id']));
			?></td>
	</tr>
	<?php endforeach; ?>

	<?php foreach($boards as $board){
					$i = 0;
					foreach($board['UserFollow'] as $userFollow){
						if($boardFolloweds){
							if($userFollow['user_id'] == $boardFolloweds[0]['UserFollow']['user_id']){
								$i = 1;
							}
								
						}
							
					}
					if($i == 0){
						echo '<tr>
								<td>'. $board['Board']['id'] .'</td>
								<td>'. $board['Board']['user_id'] .'</td>
								<td>'. $board['Board']['name'] .'</td>
								<td>'. $board['Board']['description'] .'</td>
								<td>'. $board['Board']['created'] .'</td>
								<td>'. $board['Board']['updated'] .'</td>
								<td>'. $this->Html->link('follow', array('action'=>'followBoard', $board['Board']['id'])) .'</td>
							  </tr>';
					}
					
			}
	?>
</table>
<?php echo $this->Html->link('User index', array('controller'=>'Users','action'=>'index')); ?>